// show icon  
chrome.extension.sendRequest();  
// pattern  
var reg = new RegExp('VideoIDS=', 'g');  
var msg = 'KyleTang提醒您：该页面有来自YouKu的视频';  
var oNewNode=document.createElement("p");
// filter span  
var embeds = document.getElementsByTagName('embed');  
for (var s = 0; s < embeds.length; s++) {  
  var context = embeds[s].src.replace(/<[^>]+>/g, '');  
  if (reg.test(context)) { 
	var id = context.replace(/.*VideoIDS=/g, '').replace(/&.*/g, '');
	oNewNode.innerHTML=msg+' <a href="http://v.youku.com/v_show/id_'+id+'.html" target="_blank">打开优酷页面</a>';
	embeds[s].parentNode.appendChild(oNewNode);
  }  
}  
